# -*- coding: utf-8 -*-

from django.db import models
from core.models import CoreModel, table_prefix
from django.utils.translation import gettext_lazy as _
import reversion


@reversion.register()
class TestDesign(CoreModel):
    name = models.CharField(max_length=256, verbose_name="设计名称")
    product = models.ForeignKey(
        to="pms.Product",
        related_name="testdesign_set",
        on_delete=models.CASCADE,
        db_constraint=False,
        verbose_name="所属产品",
    )

    def __str__(self) -> str:
        return self.name

    class Meta:
        db_table = table_prefix + "tms_testdesign"
        verbose_name = "测试设计"
        verbose_name_plural = verbose_name
        ordering = ("-create_time",)
